import { Router } from '@angular/router';
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-compose-message',
  templateUrl: './compose-message.component.html',
  styleUrls: ['./compose-message.component.css']
})
export class ComposeMessageComponent implements OnInit {

  // 显示发现过程的消息
  details = ''
  // 显示消息内容
  message = ''

  sending = false

  constructor(private route: Router) { }

  cancel(){
      this.closePopUp()
  }

  send(){
     this.sending = false
     this.details = 'Sending Message……'

     setTimeout(() => {
         this.sending = true
         this.closePopUp()
     }, 1000);
  }

  closePopUp(){

     // 通过将该路由的出口设置成null来阻断跳转，即不显示该路由跳转的页面
     this.route.navigate([{ outlets: { popup: null}}])
  }

  ngOnInit(): void {
  }

}
